SELECT 0 as infoRank,company,main_pro,U.userid,user,ctype,tel,contact,turnover,province,city,country,staff_num,U.logo,video ,ifpay,registered_capital,seo_detail,CASE WHEN ifpay >2 THEN ifpay + RAND() ELSE ifpay END as ifpay2 ,D.intro as detail01,cat,url,logo2 FROM (b2bbuilder_user U LEFT JOIN b2bbuilder_user_detail D ON U.userid=D.userid and D.type='1') WHERE U.userid in ( SELECT userid FROM ( SELECT U3.userid FROM (b2bbuilder_user U3 LEFT JOIN b2bbuilder_user_detail D2 ON U3.userid=D2.userid and D2.type='1') WHERE ifpay>1 and ((company regexp '晶片電容器 (ISO-9002') OR (seo regexp '晶片電容器 (ISO-9002') OR (seo_detail regexp '晶片電容器 (ISO-9002') OR (main_pro regexp '晶片電容器 (ISO-9002') OR (cat regexp '晶片電容器 (ISO-9002') OR ((select intro from b2bbuilder_user_detail where userid=U3.userid and type='1') regexp '晶片電容器 (ISO-9002') ) order by rank desc,CASE WHEN ifpay >2 THEN ifpay + RAND() ELSE ifpay END DESC,IFNULL((seo regexp '晶片電容器 (ISO-9002'),0)*100 +IFNULL((cat regexp '晶片電容器 (ISO-9002'),0)*90 +IFNULL((company regexp '晶片電容器 (ISO-9002'),0)*80 +IFNULL((main_pro regexp '晶片電容器 (ISO-9002'),0)*60 +IFNULL((seo_detail regexp '晶片電容器 (ISO-9002'),0)*50 +IFNULL(D2.intro regexp '晶片電容器 (ISO-9002',0)*40 DESC, uptime desc limit 0 , 15 ) as U2 ) order by rank desc,CASE WHEN ifpay >2 THEN ifpay + RAND() ELSE ifpay END DESC,IFNULL((seo regexp '晶片電容器 (ISO-9002'),0)*100 +IFNULL((cat regexp '晶片電容器 (ISO-9002'),0)*90 +IFNULL((company regexp '晶片電容器 (ISO-9002'),0)*80 +IFNULL((main_pro regexp '晶片電容器 (ISO-9002'),0)*60 +IFNULL((seo_detail regexp '晶片電容器 (ISO-9002'),0)*50 +IFNULL(detail01 regexp '晶片電容器 (ISO-9002',0)*40 DESC, uptime desc Got error 'parentheses not balanced' from regexp